<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>sox::SoxService</title>
  <meta http-equiv='Content-type' content='text/html;charset=UTF-8' />
  <link rel='stylesheet' type='text/css' href='../style.css'/>
</head>
<body>
<p>
  <a href='../index.html'>
    <img src='../logo.png' alt='Sedona'/>
  </a>
</p>
<div class='nav'>
  <a href='../index.html'>Index</a> |
  <a href='../api.html'>Kits</a> |
  <a href='index.html'>sox</a>
</div>
<h1 class='title'>sox::SoxService</h1>
<hr/>
<pre class='inheritance'><a href='../sys/Obj.html'>sys::Obj</a>
  <a href='../sys/Virtual.html'>sys::Virtual</a>
    <a href='../sys/Component.html'>sys::Component</a>
      <a href='../sys/Service.html'>sys::Service</a>
        sox::SoxService
</pre>
<em>public </em> class <b>SoxService</b>  <br>
<hr/>
<p>SoxService implements the Dasp/Sox protocol for network&#xa;provisioning, programming, and data access to a Sedona device.</p>
<hr/>
<dl>
<dt>datagram</dt>
<dd><p class='sig'><code><em><em>public</em> <em>inline</em> </em><b><a href='../inet/UdpDatagram.html'>UdpDatagram</a> datagram</b>

</code></p>
</dd>
<dt>dispatch</dt>
<dd><p class='sig'><code><em><em>public</em> </em><b>void dispatch()</b>

</code></p>
<p>Dispatch a received dasp/sox message.</p>
</dd>
<dt>eventsPerSec</dt>
<dd><p class='sig'><code><em><em>public</em> <em>property</em> </em><b>short eventsPerSec</b> [config]

</code></p>
<p>Max of number of async events sent per second.&#xa;Tuning this number down towards zero will decrease&#xa;the number of messages sent, but increase the latency&#xa;of real-time change propogation.  If set all the way&#xa;down to zero, then no change of value events are sent.</p>
</dd>
<dt>execute</dt>
<dd><p class='sig'><code><em><em>public</em> <em>virtual</em> <em>override</em> </em><b>void execute()</b>

</code></p>
<p>Execute - called once per cycle.</p>
</dd>
<dt>in</dt>
<dd><p class='sig'><code><em><em>public</em> <em>inline</em> </em><b><a href='../sys/BufInStream.html'>BufInStream</a> in</b>

</code></p>
</dd>
<dt>isPortOpen</dt>
<dd><p class='sig'><code><em><em>public</em> </em><b>bool isPortOpen</b>

</code></p>
</dd>
<dt>lastCompId</dt>
<dd><p class='sig'><code><em><em>public</em> </em><b>short lastCompId</b>

</code></p>
</dd>
<dt>lastHouseKeeping</dt>
<dd><p class='sig'><code><em><em>public</em> </em><b>long lastHouseKeeping</b>

</code></p>
</dd>
<dt>log</dt>
<dd><p class='sig'><code><em><em>public</em> <em>static</em> <em>const</em> <em>define</em> </em><b><a href='../sys/Log.html'>Log</a> log</b>

</code></p>
</dd>
<dt>numEventsThisPeriod</dt>
<dd><p class='sig'><code><em><em>public</em> </em><b>short numEventsThisPeriod</b>

</code></p>
</dd>
<dt>out</dt>
<dd><p class='sig'><code><em><em>public</em> <em>inline</em> </em><b><a href='../sys/BufOutStream.html'>BufOutStream</a> out</b>

</code></p>
</dd>
<dt>packet</dt>
<dd><p class='sig'><code><em><em>public</em> <em>inline</em> </em><b><a href='../sys/Buf.html'>Buf</a> packet</b>

</code></p>
</dd>
<dt>periodEnd</dt>
<dd><p class='sig'><code><em><em>public</em> </em><b>long periodEnd</b>

</code></p>
</dd>
<dt>port</dt>
<dd><p class='sig'><code><em><em>public</em> <em>property</em> </em><b>short port</b> [config, defaultOnClone]

</code></p>
<p>UDP port for listening</p>
</dd>
<dt>receiveMax</dt>
<dd><p class='sig'><code><em><em>public</em> <em>property</em> </em><b>byte receiveMax</b> [config]

</code></p>
<p>Max of number of messages in receiving window.</p>
</dd>
<dt>send</dt>
<dd><p class='sig'><code><em><em>public</em> </em><b>bool send(<a href='../sox/SoxSession.html'>SoxSession</a> s)</b>

</code></p>
<p>Send the packet over the network to the specified session.&#xa;Return true on success, false on failure.</p>
</dd>
<dt>session</dt>
<dd><p class='sig'><code><em><em>public</em> </em><b><a href='../sox/SoxSession.html'>SoxSession</a> session(int sessionId)</b>

</code></p>
<p>Lookup the session by id, update the receive ticks&#xa;and return it.  If the session id is invalid or has been&#xa;closed then return null.</p>
</dd>
<dt>sessions</dt>
<dd><p class='sig'><code><em><em>public</em> <em>inline</em> </em><b><a href='../sox/SoxSession.html'>SoxSession</a>[] sessions</b>

</code></p>
</dd>
<dt>socket</dt>
<dd><p class='sig'><code><em><em>public</em> <em>inline</em> </em><b><a href='../inet/UdpSocket.html'>UdpSocket</a> socket</b>

</code></p>
</dd>
<dt>start</dt>
<dd><p class='sig'><code><em><em>public</em> <em>virtual</em> <em>override</em> </em><b>void start()</b>

</code></p>
<p>Start the SoxService:</p>
<pre class='doc'> - init datagram.buf to use packet.bytes&#xa; - initWatches&#xa; - initTransfers&#xa; - open UDP port&#xa; - lookup user service</pre>
</dd>
<dt>stop</dt>
<dd><p class='sig'><code><em><em>public</em> <em>virtual</em> <em>override</em> </em><b>void stop()</b>

</code></p>
<p>Stop the SoxService.</p>
</dd>
<dt>userService</dt>
<dd><p class='sig'><code><em><em>public</em> </em><b><a href='../sys/UserService.html'>UserService</a> userService</b>

</code></p>
</dd>
<dt>work</dt>
<dd><p class='sig'><code><em><em>public</em> <em>virtual</em> <em>override</em> </em><b>bool work()</b>

</code></p>
<p>Check for service work:</p>
<pre class='doc'> - check if we should retry port open&#xa; - check for received packet&#xa; - if received process it&#xa; - check watches&#xa; - check events</pre>
</dd>
</dl>
<div class='nav'>
  <a href='../index.html'>Index</a> |
  <a href='../api.html'>Kits</a> |
  <a href='index.html'>sox</a>
</div>
<div class='copyright'>Copyright &#169; 2009, Tridium, Inc.</div>
</body>
</html>
